package com.jxdinfo.hussar.example.common.dict.service.impl;

import com.jxdinfo.hussar.example.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jxdinfo.hussar.example.common.dict.dao.SysDictSingleMapper;
import com.jxdinfo.hussar.example.common.dict.domain.SysDictSingle;
import com.jxdinfo.hussar.example.common.dict.service.ISysDictSingleService;

import java.util.List;
/**
 * 字典字段Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-21
 */
@Service
public class SysDictSingleServiceImpl implements ISysDictSingleService
{
    @Autowired
    private SysDictSingleMapper sysDictSingleMapper;

    /**
     * 查询字典字段
     *
     * @param dictId 字典字段主键
     * @return 字典字段
     */
    @Override
    public SysDictSingle selectSysDictSingleByDictId(Long dictId)
    {
        return sysDictSingleMapper.selectSysDictSingleByDictId(dictId);
    }

    /**
     * 查询字典字段列表
     *
     * @param sysDictSingle 字典字段
     * @return 字典字段
     */
    @Override
    public List<SysDictSingle> selectSysDictSingleList(SysDictSingle sysDictSingle)
    {
        return sysDictSingleMapper.selectSysDictSingleList(sysDictSingle);
    }

    /**
     * 新增字典字段
     *
     * @param sysDictSingle 字典字段
     * @return 结果
     */
    @Override
    public int insertSysDictSingle(SysDictSingle sysDictSingle)
    {
        sysDictSingle.setCreateTime(DateUtils.getNowDate());
        return sysDictSingleMapper.insertSysDictSingle(sysDictSingle);
    }

    /**
     * 修改字典字段
     *
     * @param sysDictSingle 字典字段
     * @return 结果
     */
    @Override
    public int updateSysDictSingle(SysDictSingle sysDictSingle)
    {
        return sysDictSingleMapper.updateSysDictSingle(sysDictSingle);
    }

    /**
     * 批量删除字典字段
     *
     * @param dictIds 需要删除的字典字段主键
     * @return 结果
     */
    @Override
    public int deleteSysDictSingleByDictIds(Long[] dictIds)
    {
        return sysDictSingleMapper.deleteSysDictSingleByDictIds(dictIds);
    }

    /**
     * 删除字典字段信息
     *
     * @param dictId 字典字段主键
     * @return 结果
     */
    @Override
    public int deleteSysDictSingleByDictId(Long dictId)
    {
        return sysDictSingleMapper.deleteSysDictSingleByDictId(dictId);
    }
}
